#include <bits/stdc++.h>
using namespace std;

int a[100010], cnt[100010], num[100010], dic[100010];

int main() {
    freopen("duel.in", "r", stdin);
    freopen("duel.out", "w", stdout);
    memset(cnt, 0, sizeof(cnt));
    int n, ma = 0, ans = 0;
    scanf("%d", &n);
    for (int i = 0; i < n; i++) {
        scanf("%d", &a[i]);
        cnt[a[i]]++;
        ma = max(a[i], ma);
    }
    int tot = 0;
    for (int i = 1; i <= ma; i++) {
        if (cnt[i] > 0) {
            num[tot] = i;
            dic[i] = tot;
            tot++;
        }
    }
    sort(a, a+n);
    //for (int i = 0; i < n; i++) printf("%d ", a[i]);
    //printf("\n");
    for (int i = 0; i < n; i++) {
        //printf("index: %d, num: %d\n", i, a[i]);
        int j = a[i];
        while (1) {
            //o++;
            //printf("now judging: %d\n", j);
            if (cnt[j] > 0 && j < a[i]) {
                //printf("fit");
                cnt[j]--;
                break;
            }
            if (dic[j] == 0) break;
            j = num[dic[j]-1];
        }
    }
    for (int i = 1; i <= ma; i++) {
        ans += cnt[i];
    }
    cout << ans;
    return 0;
}
